<?php

namespace App\Http\Controllers;

use App\Http\Service\UserFollowService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class UserFollowController extends BaseController
{
    private $getRules=[
            'unique_id'=> 'required',
            'people_id'=> 'required',
        ];
    private  $getRulesMessage=[
            'unique_id.required'=> '唯一标识【unique_id】不能为空',
            'people_id.required'=> '用户id【people_id】不能为空',
        ];
    public $repository;
    public function __construct(UserFollowService $repository)
    {
        parent::__construct();
        $this->repository = $repository;
    }

   
    //用户与用户关注-添加
    public function addDate(Request $request)
    {
        $data=[
            'follower_id'=>$request->json("follower_id"),
            'following_id'=>$request->input("following_id"),
        ];
        $this->success($this->repository->addDate($request,$data));

    }
    //豆瓣喜欢-列表
    public function getList(Request $request)
    {
        $data=[
            "people_id"=>$request->json("people_id"),
        ];
        $this->success($this->repository->getList($request,$data));
    }

     //豆瓣-删除
    public function del(Request $request)
    {
        $ids = $request->json('id');
        if(empty($ids)){
            $this->error('参数错误');
        }
        $data=[
        
        ];
        $this->repository->del($request,$data,$ids);
    }


  

}
